package test123;

import java.util.*;

class cow {
	int age;

	cow(int Age) {
		this.age = Age;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public cow birth(cow newcow) {
		if (newcow.age >= 5)

			return new cow(0);

		else
			return null;
	}
}

class farm {
	List<cow> arrycows;

	farm() {
		arrycows = new ArrayList<cow>();
	}

	public int getSum() {
		return arrycows.size();
	}

}

public class Testbirth {
	public static void main(String args[]) {
		farm newfarm = new farm();
		newfarm.arrycows.add(new cow(5));

		for (int i = 0; i < 20; i++) {
			for (int j = 0; j < newfarm.getSum(); j++) {
				cow m = newfarm.arrycows.get(j);

				if (m.birth(m) == null) {

				} else {
					newfarm.arrycows.add(m.birth(m));
				}
				m.age++;
			}
		}
		System.out.println(newfarm.getSum());
	}
}